package org.example.myerp.service.serviceimpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.example.myerp.mapper.productDesign.customSetup.ProclassThreeMapper;
import org.example.myerp.pojo.PageMyself;
import org.example.myerp.pojo.*;
import org.example.myerp.service.ProclassThreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ��������˵�ҵ���ʵ����
 *
 * @author DELL
 *
 */
@Service
public class ProclassThreeServiceImpl implements ProclassThreeService {
	@Autowired
    ProclassThreeMapper proclassThreeMapper;

	/**
	 * ��ѯȫ����������
	 */
	@Override
	public List<ProclassThree> getFindThreeCslassifyAll() {
		List<ProclassThree> list = proclassThreeMapper.findThreeCslassifyAll();
		return list;
	}
	/**
	 * ���ݶ�����Ų�ѯ����������Ϣ
	 */
	@Override
	public List<ProclassThree> getByProcalssTwoByIiIdfindProclassThree(Integer iiId) {
		List<ProclassThree> list = proclassThreeMapper.byProcalssTwoByIiIdfindProclassThree(iiId);
		return list;
	}

	/**
	 * ��ҳ��ѯ��Ʒ������������ȫ����Ϣ
	 */
	@Override
	public PageMyself<ProclassThreeMapper> findThreeCslassifyByPagerMessage(Integer pageNum, Integer pageSize, String proName) {
		// �洢�������в�������
		Map params = new HashMap<String, Object>();
		params.put("pageNum", pageNum);
		params.put("pageSize", pageSize);
		params.put("proName","%" + proName + "%");
		// ������ҳ�����࣬��Ϊ����ֵ
		PageMyself<ProclassThreeMapper> page = new PageMyself<ProclassThreeMapper>();
		// ���õ�ǰҳ���ҳ��С
		if(pageNum != null && pageSize != null) {
			//���õ�ǰҳ���ҳ��С
			page.setPageNum(pageNum);
			page.setPageSize(pageSize);
		}
		// ��ȡ��ǰҳ����
		List<ProclassThreeMapper> list = proclassThreeMapper.findThreeCslassifyByPagerMessage(params);
		// ���÷�ҳ���������ʾ����
		page.setRows(list);
		// ����������
		page.setTotal(proclassThreeMapper.findThreeCslassifyTotalNumber("%" + proName + "%"));
		return page;
	}

	/**
	 * �������������Ϣ
	 */
	@Override
	public Integer getInsertThreeCslassifyByProName(ProclassThree proclassThree) {
		Integer row = proclassThreeMapper.insertThreeCslassifyByProName(proclassThree);
		return proclassThree.getIiiId();
	}

	/**
	 * ɾ������������Ϣ
	 */
	@Override
	public Integer getdeleteInBatchesThreeCslassifyByIIIds(Integer[] iiiIds) {
		Integer row = proclassThreeMapper.deleteInBatchesThreeCslassifyByIIIds(iiiIds);
		return row;
	}
}
